package com.zwl.chengguangservice.config;

import com.zwl.chengguangservice.bean.AliPayConfigInjector;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * 支付宝支付全局统一配置
 *
 * @author yangyuan
 * @date 2017年4月28日
 */
@Configuration
public class AliPayConfig {

    @Value("${pay.ali.appid:}")
    private String _appid = "2021001177633558";
    @Value("${pay.ali.privateKey:}")
    private String _privateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDNsDNLJ9XfuLk+feThCkOvGED2cBd5kUHbgiFzwarIyFymVZ/A0Tvi8J+mBu3HoVOV9vj7BbLhyzUVrqbDIwCNc4RbIDzdo8BDRhUWsQHU0iZPRIpOLNdKpp0tWPLtEjl6etZdRY+22Cer/ihBves2ODNMlGTdideO3uwImHe8x3Wapsu9WhHNAYRJU2Gv2DcIKyVsjeXWxMPDvLjoSgwXP7dNJqFUxx//sxl4bRDdAbYH+MAaaPxkx3xTJIrdr5rr3TLuIM4r6yWSdTOEYpNhm7erAtomVmW4l012tSUsTr8wW4K5beodLhMbj6oPCjoUErCmzM/AqFiIS8LXZIELAgMBAAECggEAc/4vjuxyAe4MGR+p2PaO4MkOqWrg8h9mQkGKV9sZUo0bInoa0wOrf/kuLtStduyVVHaoRfcav5Z24zlQta6heyNvumvdpyfXHpkA/4DmhXvVOtJuJFPJPUHkVVRZ+jNS0q0/Ae5ec0BGbwmu7hQJ9tOOqlrs3roDI4C3HsnMjFnzH6Ms4bF8i+JmnwHxBwSlzMDzA/GRuRJGlT3oIwXhynRZjb7pClIfCma8MWWdrtHOjeR0sw6GOyS9cxXzHTgzcKUvYdw5UM+OwguLwGe0LRQkuzmj9lrX3d+6tZqJZyUekeoyfSOsX0ZdD5B+ORVZmICxRGljC+65Wtc/TFKAAQKBgQD7rTNaufgZaYunslfyDAl+2CXtJBGREIoTWwBesx+dOGJdotxUSrGluhO/AlYM0each2I6meImJIF1+/0Pbkle7z7M4FriqdU7+F2VFJUYjy5KlwYkhu/XwVjZc3agHZnV2u1gjeymIRtyOWRBP/PVp/AswN9eE1Cb/Vm31CuhCwKBgQDROMHAhtKgM3qcJaf312oNx29FPnASs8a8tuTn824y9yYjBq0rGn4I7q3XDy/cklH2zRup+1uXTYLEvrpF7LIbEJroSK5jcfQ5P7IWaK+Jx0XqwxDfPSG29BocegQbLUcjRqgw4xPP24aRDKJCtu4IOltivSpx7mMEqtwjuvagAQKBgQCRBqRyInnyAt0D/IQrKX6LRnjMZx1sT3CRaL4U0/liuqwMMx3twMEPs+NPDUSSzJ2sE2OqSySDQEQNvfB8ZNwIxaqVmq8ksCL9FMiwcJTd+xv8xXw3rj4lQPg3Dg8MgyIzlp11JzN4I9nR/3pjEzwqIUUINPhCGLU5vktl3/BoMwKBgDbkyFkmRp8HwrSzYJWzbDz/RZ+KWUde6dbbucVt5kzy8YuhFdBIXCcl0HCrqGgb7+tsN0TrEUXqbVQHosHz72sQeURWxYKMBIL8xlIA14WzxhFpasTXuj/RXgR4sxkaUR7dTAW/npQbyfvGr9AHRP7dqNqIPVm1LT+tQKMTS+ABAoGAE69mZk+gonSJ4jrG9hf3oRYTYuKegAwMmgIpuDhc8rXlIFjQKxETg4rROv5YIy1YuA9VOmH435Z3fUrteXsdu27746OnAMt7QxnYwmxj9lmY+Fd/SvmN4283XGFo/Ff4rkUQqie1MZdXqpsO4IHmNJiLQ/Mw9V6enQvq4gyBE7U=";;
    @Value("${pay.ali.notifyURL:}")
    private String _notifyURL;

    /**
     * 应用ID
     */
    private static String appid;
    /**
     * 商户的私钥
     */
    private static String privateKey;
    /**
     * 支付回调地址
     */
    private static String notifyURL = "";
    /**
     * 支付宝网关
     */
    private static String gateway = "https://openapi.alipay.com/gateway.do";
    /**
     * 支付宝的公钥
     */
    private static String aliPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvsH3SyXNZNIcMiwgvzJWXvocYZwN0XHSq1ix06maJt8aJ6tTl+iG6vEkhQzIpsnZOyNW3aVaE3jEmRE51kKR81pO3Ulj3wg2wE6DufGmTobDclrjZlEJgCjINC+p10YEMo83CWhlPhtTmcY3cGqRpfBsacHXtU4vMwsR1WH3amAwKaPZVHqX0WH+mwMUW41UU1NFwOB5LqbmtnupEMwQ77M6DsxtTTXG4laQReQIvLkg8PGEm9U0jfqvLqfxFNj701BjR2BwN22jPJtCZji/tYWlUUVS2EtZVbvu8tj7hcRGyiQBvLNNhsiNfVH5UXtA6d5SuRIu+T4Sbj8yMKgbmwIDAQAB";

    @Bean
    public AliPayConfigInjector aliPayConfigInjector() {
        AliPayConfigInjector  aliPayConfigInjector=new AliPayConfigInjector();
        appid = _appid;
        privateKey = _privateKey;
        notifyURL = _notifyURL;
        aliPayConfigInjector.setAppid(_appid);
        aliPayConfigInjector.setPrivateKey(_privateKey);
        return aliPayConfigInjector;
    }

    public static String getAppid() {
        return appid;
    }

    public static String getPrivateKey() {
        return privateKey;
    }

    public static String getNotifyURL() {
        return notifyURL;
    }

    public static String getGateway() {
        return gateway;
    }

    public static String getAliPublicKey() {
        return aliPublicKey;
    }
}
